/**
  ******************************************************************************
  * @file           : tskcfg.h
  * @brief          : Header for main.c file.
  *                   This file contains the common defines of the application.
  ******************************************************************************
  * @attention
  *
  ******************************************************************************
  */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __TSKCFG_H
#define __TSKCFG_H

/* Includes ------------------------------------------------------------------*/
#include <stdio.h>

#include "FreeRTOS.h"
#include "task.h"
#include "timers.h"
#include "queue.h"
#include "semphr.h"
#include "stream_buffer.h"
#include "event_groups.h"

#define RUNDOG_TSK_PRIORITY                                              (tskIDLE_PRIORITY + 1)
#define RUNDOG_STACK_SIZE                                                128u
extern TaskHandle_t xRunDog_Thd;
extern StaticTask_t xRunDog_Tcb;
extern StackType_t  xRunDog_Stk[ RUNDOG_STACK_SIZE ];
void vRunDog_Task( void * pvParameters );

#define TTY_TSK_PRIORITY                                                 (tskIDLE_PRIORITY + 2)
#define TTY_STACK_SIZE                                                   256u
extern TaskHandle_t xTerminal_Thd;
extern StaticTask_t xTerminal_Tcb;
extern StackType_t  xTerminal_Stk[ TTY_STACK_SIZE ];
extern void vTerminal_Task( void * pvParameters );

#define LEDSCREEN_TSK_PRIORITY                                           (tskIDLE_PRIORITY + 2)
#define LEDSCREEN_STACK_SIZE                                             256u
extern TaskHandle_t xLedScreen_Thd;
extern StaticTask_t xLedScreen_Tcb;
extern StackType_t  xLedScreen_Stk[LEDSCREEN_STACK_SIZE];
extern void vLedScreen_Task(void * pvParameters);

#define STGPARA_TSK_PRIORITY                                             (tskIDLE_PRIORITY + 3)
#define STGPARA_STACK_SIZE                                               256u
extern TaskHandle_t xStoragePara_Thd;
extern StaticTask_t xStoragePara_Tcb;
extern StackType_t  xStoragePara_Stk[ STGPARA_STACK_SIZE ];
extern void vStoragePara_Task(void * pvParameters);

#define DWLCDRX_TSK_PRIORITY                                             (tskIDLE_PRIORITY + 4)
#define DWLCDRX_STACK_SIZE                                               512u
extern TaskHandle_t xDwLcdRx_Thd;
extern StaticTask_t xDwLcdRx_Tcb;
extern StackType_t  xDwLcdRx_Stk[ DWLCDRX_STACK_SIZE ];
extern void vDwlcdRecv_Task(void * pvParameters);

#define DWLCDTX_TSK_PRIORITY                                             (tskIDLE_PRIORITY + 4)
#define DWLCDTX_STACK_SIZE                                               256u
extern TaskHandle_t xDwLcdTx_Thd;
extern StaticTask_t xDwLcdTx_Tcb;
extern StackType_t  xDwLcdTx_Stk[ DWLCDTX_STACK_SIZE ];
extern void vDwlcdSend_Task(void * pvParameters);

#define CTRVFD_TSK_PRIORITY                                              (tskIDLE_PRIORITY + 5)
#define CTRVFD_STACK_SIZE                                                256u
extern TaskHandle_t xCtrVfd_Thd;
extern StaticTask_t xCtrVfd_Tcb;
extern StackType_t  xCtrVfd_Stk[ CTRVFD_STACK_SIZE ];
extern void vCtrVfd_Task( void * pvParameters );

#define ROUTE_485_TSK_PRIORITY                                           (tskIDLE_PRIORITY + 6)
#define ROUTE_485_STACK_SIZE                                             512u
extern TaskHandle_t xRoute_485_Thd;
extern StaticTask_t xRoute_485_Tcb;
extern StackType_t  xRoute_485_Stk[ROUTE_485_STACK_SIZE];
extern void vRoute_485_Task(void * pvParameters);

/* ethernet transmit task */                                             /* subtask */
#define NETWORK_TRAN_TSK_PRIORITY                                        (tskIDLE_PRIORITY + 7)
#define NETWORK_TRAN_STACK_SIZE                                          4096u
extern TaskHandle_t xNetWorkTran_Thd;
extern StaticTask_t xNetWorkTran_Tcb;
extern StackType_t  xNetWorkTran_Stk[ NETWORK_TRAN_STACK_SIZE ];
extern void vNetWorkTransmit_Task(void * pvParameters);

/* ethernet receive task */
#define NETWORK_RECV_TSK_PRIORITY                                        (tskIDLE_PRIORITY + 8)
#define NETWORK_RECV_STACK_SIZE                                          5120u
extern TaskHandle_t xNetWorkRecv_Thd;
extern StaticTask_t xNetWorkRecv_Tcb;
extern StackType_t  xNetWorkRecv_Stk[ NETWORK_RECV_STACK_SIZE ];
extern void vNetWorkReceive_Task(void * pvParameters);

#define CONTROL_TSK_PRIORITY                                             (tskIDLE_PRIORITY + 9)
#define CONTROL_STACK_SIZE                                               512u
extern TaskHandle_t xControl_Thd;
extern StaticTask_t xControl_Tcb;
extern StackType_t  xControl_Stk[ CONTROL_STACK_SIZE ];
extern void vControl_Task( void * pvParameters );

#if(COLLECTOR_USE_TYPE == COLLECTOR_USE_LORA)
/* lora task */
#define COLLERTOR_TSK_PRIORITY                                           (tskIDLE_PRIORITY + 10)
#define COLLERTOR_STACK_SIZE                                             512u
extern TaskHandle_t xCollertor_Thd;
extern StaticTask_t xCollertor_Tcb;
extern StackType_t  xCollertor_Stk[ COLLERTOR_STACK_SIZE ];
extern void vCollertor_Task(void * pvParameters);
#endif

#define ADCNTC_TSK_PRIORITY                                             (tskIDLE_PRIORITY + 10)
#define ADCNTC_STACK_SIZE                                               512u
extern TaskHandle_t xAdcNtc_Thd;
extern StaticTask_t xAdcNtc_Tcb;
extern StackType_t  xAdcNtc_Stk[ ADCNTC_STACK_SIZE ];
extern void vAdcNtc_Task(void * pvParameters);

#define ROUTE_TSK_PRIORITY                                               (tskIDLE_PRIORITY + 11)
#define ROUTE_STACK_SIZE                                                 512u
extern TaskHandle_t xRoute_Thd;
extern StaticTask_t xRoute_Tcb;
extern StackType_t  xRoute_Stk[ROUTE_STACK_SIZE];
extern void vRoute_Task(void * pvParameters);

extern QueueHandle_t TTYRecv_qhd;

extern QueueHandle_t Storage_qhd;
extern QueueHandle_t Network_Acks_qhd;

extern QueueHandle_t Route_NetToLoc_Qhd;
extern QueueHandle_t Route_EvewTo485_Qhd;
extern QueueHandle_t Route_EvewToNet_Qhd;

extern QueueHandle_t Route_485RxLink_Qhd;

extern QueueHandle_t Dw_Rx_Qhd;
extern QueueHandle_t Dw_Tx_Qhd;

extern StreamBufferHandle_t NetWork_StreamBuffer_sbhd;

extern QueueHandle_t NTC_TrsMsg_Qhd;

extern void APP_CreateTask(void);

#endif /* __TSKCFG_H */

/************************ END OF FILE *********/
